package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * Created by usera on 2017/10/24.
 */

public class FavouriteRequest {
    int goodsId;
    int type;

    private FavouriteRequest(Builder builder) {
        setGoodsId(builder.goodsId);
        setType(builder.type);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public static final class Builder {
        private int goodsId;
        private int type;

        private Builder() {
        }

        public Builder goodsId(int goodsId) {
            this.goodsId = goodsId;
            return this;
        }

        public Builder favourite() {
            this.type = 1;
            return this;
        }

        public Builder dontFavourite() {
            this.type = 0;
            return this;
        }

        public Call<ResponseBody> build() {
            return ApiManager.getService().favourite(new FavouriteRequest(this));
        }
    }
}
